package handler

import (
	"github.com/gin-gonic/gin"
	"pic-share-hubb/model"
	"pic-share-hubb/pkg"
)

func Register(c *gin.Context) {
	username := c.PostForm("username")
	password := c.PostForm("password")
	data := model.User{
		Username: username,
		Password: pkg.Md5(password),
	}
	model.DB.Create(&data)
	c.JSON(200, gin.H{
		"code": 200,
		"msg":  "OK",
	})
	return
}
